package cn.caplike.demo.repository.fastjson;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.List;

@SuppressWarnings("unused")
public class AuthenticatedPrincipalToken {

    private AuthSchema authSchema;

    public AuthSchema getAuthSchema() {
        return authSchema;
    }

    public void setAuthSchema(AuthSchema authSchema) {
        this.authSchema = authSchema;
    }

    // @formatter:off
    @JSONField private String userId;
    @JSONField(ordinal = 1) private String tenantId;
    @JSONField(ordinal = 2) private String deptId;
    /** 用户禁用状态. 1: 启用; 0: 禁用; */ @JSONField(ordinal = 3) private int status;

    @JSONField(ordinal = 4) private String username;
    @JSONField(ordinal = 5) private String nickname;

    /** 令牌 (Plain Token) */ @JSONField(ordinal = 6) private String token;
    /** 用户访问权限 */ @JSONField(ordinal = 7) private List<String> userPermissions;

    // -----------------------------------------------------------------------------------------------------------------
    @JSONField(serialize = false, deserialize = false) private String host;

    public AuthenticatedPrincipalToken() { this(null, null); }
    public AuthenticatedPrincipalToken(String token) { this(token, null); }
    public AuthenticatedPrincipalToken(String token, String host) {
        this.token = token;
        this.host  = host;
    }

    // -----------------------------------------------------------------------------------------------------------------
    /* -- ACCESSORS and MUTATORS -- */
    public String getUserId() { return userId; }
    public   void setUserId(String userId) { this.userId = userId; }
    public String getTenantId() { return tenantId; }
    public   void setTenantId(String tenantId) { this.tenantId = tenantId; }
    public String getDeptId() { return deptId; }
    public   void setDeptId(String deptId) { this.deptId = deptId; }
    public    int getStatus() { return status; }
    public   void setStatus(int status) { this.status = status; }

    public String getUsername() { return username; }
    public   void setUsername(String username) { this.username = username; }
    public String getNickname() { return nickname; }
    public   void setNickname(String nickname) { this.nickname = nickname; }

    public String getToken() { return token; }
    public   void setToken(String token) { this.token = token; }
    public List<String> getUserPermissions() { return userPermissions; }
    public         void setUserPermissions(List<String> userPermissions) { this.userPermissions = userPermissions; }

    // -----------------------------------------------------------------------------------------------------------------
    public   void setHost(String host) { this.host = host; }
    public String getHost() { return host; }

}
